<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>TODO: dynamic site title: Admin <%= controller.controller_name %></title>
    <%= stylesheets %>
    <%= stylesheet_link_tag "railscart-admin.css", :plugin => "railscart" %>
    <%= javascript_include_tag :defaults %>
    <%= yield :head %>
  </head>
  <body>
    <div id="main">
    	<% if logged_in? -%>
	      <ul id="login-nav">
	      	<li>Logged in as: <%= current_user.login -%></li>
	        <li><%= link_to 'Account', :controller => 'users', :action => 'show', :id => current_user %></li>
	        <li><%= link_to 'Logout', :controller => '/account', :action => 'logout' %></li>
	      </ul>
      <% end -%>      
      <table width="780">
        <tr>
          <td rowspan="3"><%= image_tag "railscart/railscart_logo142x65.gif", :plugin=>"railscart" %></td>
          <td>
            <!-- TODO: may want to restrict to admin users only (instead of any authenticated user) -->
            <% if logged_in? -%>
              <div id="admin-nav">
                <ul>
                  <li><%= link_to 'Overview', :controller => '/admin/overview' %></li>
                  <li><%= link_to 'Orders', :controller => '/admin/orders' %></li>            
                  <li><%= link_to 'Products', :controller => '/admin/products' %></li>                                    
                  <li><%= link_to 'Reports', :controller => '/admin/reports' %></li>
                  <li><%= link_to 'Users', :controller => '/admin/users' %></li>
                </ul>
              </div>
            <% end -%>
          </td>
        </tr>
        <%= yield :form if @content_for_form %>
          <tr>
            <td>
              <div id="admin-sub-nav">
                <%= yield :action_nav %>
              </div>
            </td>
          </tr>
          <tr><td colspan="2">&nbsp;</td></tr> <!--spacer -->  
          <tr>
            <td colspan="2">
              <div id="flashes">
                <% if flash[:error] %>
                  <div id="flash-errors"><%= flash[:error] %></div>
                <% end %>
                <% if flash[:notice] %>
                  <div id="flash-notice"><%= flash[:notice] %></div>
                <% end %>
              </div>                
            </td>
          </tr>
          <tr>
            <td colspan="2">
              <%= yield %>
            </td>
          </tr>
        <%= '</form>' if @content_for_form %>
      </table>
    </div>
  </body>
</html>